package com.sinothk.lab.test0324validateparam;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/t")
public class ValidateParamController {

    /**
     * 使用Defaul分组进行验证
     * @param resume
     * @return
     */
    @PostMapping("/test")
    public String addUser(@Validated(value = C.class) @RequestBody Resume resume) {
        return "validate5";
    }

    /**
     * 使用Default、Update分组进行验证
     * @param resume
     * @return
     */
    @PutMapping("/test2")
    public String updateUser(@Validated(value = {U.class}) @RequestBody Resume resume) {
        return "validate6";
    }

}
